<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>会员中心</title>
		<link rel="stylesheet" type="text/css" href="/css/base.css" />
		<link rel="stylesheet" type="text/css" href="/css/member.css" />
		<link rel="stylesheet" type="text/css" href="/css/member_main.css" />
		<link rel="stylesheet" type="text/css" href="/css/member_address.css" />
		<script src="/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="/js/member_address.js" type="text/javascript" charset="utf-8"></script>
		<script src="/js/search.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<div id="container">
			<!--设置整个页面居中，需要设定margin并且需要设定width宽度-->
			<!--开头-->
			<% include ../template/header.html %><!--新版导航结束-->
			<!--导航结束-->
			<!--内容开始-->
			<div id="content" class="clearfix">
				<!--外层布局-->
				<!--左栏-->
				<% include ../template/member_siderlist.html %>					
				<!--会员中心主内容区域-->
				<div class="sider_right fr">
					<!--收货地址区域-->
					<!--添加收货地址-->
					<div class="member_addressInfo clearfix">
						<div class="adrs_left fl">
							已有<span class="red"><%=addresslistcount%></span>个收货地址（最多添加10个收货地址）
						</div>
						<div class="adrs_right fr">
							<input type="button" id="add_panel" value="添加收货地址" />
						</div>
					</div>
					<!--添加收货地址区域-->
					<div class="member_address hidden">
						<form action="/member/addresshandle" method="post">						
						<table class="add_adrs">
							<tr>
								<td class="width200"><span class="red">*</span>收货地区：</td>
								<td class="width400 selectCIty">
									<select name="maincitylist">										
										<option value="-1">请选择</option>
										<%for(i=0;i<citylist.length;i++){%>
										  <option value="<%=citylist[i].area_Id%>"><%=citylist[i].area_name%></option>
										<%}%>
									</select>
									<input type="text" class="hidden" name="cityText" id="cityText" value="" />
									<select name="areaOfCity" class="areaOfCity">
										<option value="-1">请选择</option>
										<option value="15">西青区</option>
									</select>
									<input type="text" class="hidden" name="AreaText" id="AreaText" value="" />
									<select name="streetOfArea" class="streetOfArea">
										<option value="-1">请选择</option>
									</select>
									<input type="text" class="hidden" name="streetText" id="streetText" value="" />
								</td>
							</tr>
							<tr>
								<td class="width200"><span class="red">*</span>详细地址：</td>
								<td class="width400"><input type="text" class="adrs_detail" name="adrs_detail" id="adrs_detail" value="" /></td>
							</tr>
							<tr>
								<td class="width200">邮编：</td>
								<td class="width400"><input type="text" name="adrs_code" id="adrs_code" value="" /></td>
							</tr>
							<tr>
								<td class="width200"><span class="red">*</span>收货人姓名：</td>
								<td class="width400"><input type="text" name="customer_name" id="customer_name" value="" /> (请填写联系人真实姓名)</td>
							</tr>
							<tr>
								<td class="width200"><span class="red">*</span>身份证号：</td>
								<td class="width400"><input type="text" name="customer_code" id="customer_code" value="" /></td>
							</tr>
							<tr>
								<td class="width200"><span class="red">*</span>手机：</td>
								<td class="width400"><input type="text" name="customer_mobile" id="customer_mobile" value="" /> </td>
							</tr>
							<tr>
								<td class="width200">固定电话：</td>
								<td class="width400"> <input type="text" name="customer_tel" id="customer_tel" value="" /></td>
							</tr>
							<tr>
								<td colspan="2" class="set_default"><input type="checkbox" name="is_default" id="is_default" value="1" />设置为默认</td>
							</tr>
							<tr>
								<td colspan="2" class="set_button_panel">
									<input type="submit" id="sumbit_btn" value="添加" />
									<input type="button" id="cancel_btn" value="取消" />
								</td>
							</tr>
						</table>
					    </form>
					</div>
					<!--收货地址列表-->
					<div class="member_adrslist">
						<div class="member-mod-title">
							<h2>收货地址列表</h2>
						</div>
						<div class="member-mod-content">
							<table>
								<thead>
									<tr>
										<th>收货人</th>
										<th>收货地址</th>
										<th>联系电话</th>
										<th>操作</th>
										<th>默认</th>
									</tr>
								</thead>
								<%if(addresslist.length>0){%>
								<tbody>
									<%for(i=0;i<addresslist.length;i++){%>
									<tr class="member_listitem">
										<td class="customer"><%=addresslist[i].customer_name%></td>
										<td class="adrs_detail"><%=addresslist[i].address_details%></td>
										<td class="width100"><%=addresslist[i].mobilephone%></td>
										<td class="width100"><a href="#">编辑</a> <a href="/member/deleteAddressHandle/<%=addresslist[i].address_Id%>" onclick="return confirm('确定删除当前地址吗？')">删除</a></td>
										<%if(addresslist[i].isDefault==1){%>
										<td class="is_default"><a class="is_select" href="#">设置默认</a></td>
									    <%}else{%>
									    <td class="is_default"><a href="/member/updateAdrsDefaulthandle/<%=addresslist[i].address_Id%>" onclick="return confirm('确定设置为默认吗？')">设置默认</a></td>	
									    <%}%>
									</tr>
									<%}%>									
								</tbody>
								<%}else{%>
								<tbody>
									<tr class="no-information">
										<td colspan="5">暂无地址,请添加</td>
									</tr>
								</tbody>
								<%}%>
							</table>
						</div>
					</div>
				</div>
			</div>
			<!--内容结束-->
			<!--footer开始-->
			<% include ../template/footer.html %>				
			<!--footer结束-->
		</div>
	</body>

</html>